package cn.itcast.service.company.impl;

import cn.itcast.dao.system.RemarkDao;
import cn.itcast.domain.company.Company;
import cn.itcast.domain.system.Remark;
import cn.itcast.service.company.RemarkService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class RemarkServiceImpl implements RemarkService {


    @Autowired
    private RemarkDao remarkDao;

    @Override
    public List<Remark> findAll() {
        return remarkDao.findAll();
    }

    @Override
    public void save(Remark remark) {
       remarkDao.save(remark);

    }

    @Override
    public PageInfo<Remark> findByPage(int pageNum, int pageSize) {
        //设置当前页与页面大小
        PageHelper.startPage(pageNum, pageSize);
        //查询企业所有
        List<Remark> list = remarkDao.findAll();
        PageInfo<Remark> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
